package kr.hkit.androidcomplete02.ch13;

import java.util.Calendar;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.CalendarView;
import android.widget.Toast;

public class CalendarViewEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_calendarview);
		
		CalendarView calendar = (CalendarView)findViewById(R.id.calendar);
		calendar.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
			
			@Override
			public void onSelectedDayChange(CalendarView view, int year, int month,
					int dayOfMonth) {
				Toast.makeText(CalendarViewEx.this, "" + year + "/" + (month+1) + "/" + dayOfMonth, 0).show();
			}
		});
	}
}
